<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="beans.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		String userno = request.getParameter("userno");
		String userpwd = request.getParameter("userpwd");
		String userident = request.getParameter("userident");
		
		//显示出来后，再进行跳转
		
		boolean flag=true;//1合法性检查
		UserDAO userDAO=new  UserDAO();
		flag=userDAO.login(userno, userpwd);
		if(flag){
			session.setAttribute("userno", userno);
			session.setAttribute("userident", userident);
			if(userident.equals("管理员")){
				response.sendRedirect("mainadmin.jsp");
			}else{
				response.sendRedirect("main.jsp");
			}			
		}else{
			response.sendRedirect("error.jsp");
		}
	%>

	<%=userno%>
	<%=userpwd%>
	<%=userident%>

</body>
</html>